﻿@model byte
@{
    List<SelectListItem> list = new List<SelectListItem>();
    foreach (StoryType storyType in Enum.GetValues(typeof(StoryType))) {
        var text = System.Text.RegularExpressions.Regex.Matches(storyType.ToString(), "[A-Z][a-z]+").OfType<System.Text.RegularExpressions.Match>().Select(match => match.Value).Aggregate((acc, b) => acc + " " + b).TrimStart(' ');
        list.Add(new SelectListItem() { Text = text, Value = ((byte)storyType).ToString(), Selected = Model == (byte)storyType });
    }
    //list.Add(new SelectListItem(){ Text = "Feature", Value = ((byte)StoryType.Feature).ToString(), Selected = Model == (byte)StoryType.Feature });
    //list.Add(new SelectListItem(){ Text = "Bug", Value = ((byte)StoryType.Bug).ToString(), Selected = Model == (byte)StoryType.Bug });
    //list.Add(new SelectListItem() { Text = "Technical Work", Value = ((byte)StoryType.TechnicalWork).ToString(), Selected = Model == (byte)StoryType.TechnicalWork });
    //list.Add(new SelectListItem() { Text = "Knowledge Aquisition", Value = ((byte)StoryType.KnowledgeAquisition).ToString(), Selected = Model == (byte)StoryType.KnowledgeAquisition });
    
    @Html.DropDownListFor(m => m, list)
}

